package com.pmcc.platform.shop.repository;


import com.pmcc.platform.shop.entity.ShopInfo;
import org.omg.PortableServer.LIFESPAN_POLICY_ID;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.security.access.method.P;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * @author chenqf
 * @ClassName ShopInfoRepository
 * @Description 店铺信息
 * @date 2018/8/20 20:20
 * @Version 1.0
 */
public interface ShopInfoRepository extends JpaRepository<ShopInfo, String> {

    Page<ShopInfo> findAllByDelFlag(String delFlag, Pageable pageable);

    Page<ShopInfo> findAllByDelFlagAndNameContainsAndBossNameContainsAndProvincesContainsAndCityContainsAndAreaContainsOrderByCreateTimeDesc(String delFlag,String name,String bossName,String  provinces,String city,String area ,Pageable pageable);

    ShopInfo findAllByDelFlagAndId(String delFlag,String id);

    Page<ShopInfo>findAllBySalesmanIdAndDelFlag(String salesmanId,String delFlag, Pageable pageable);

    Page<ShopInfo>findAllBySalesmanIdAndDelFlagAndNameContaining(String salesmanId,String delFlag,String name , Pageable pageable);

    Page<ShopInfo> findAllBySalesmanIdAndDelFlagAndPhoneContains(String salesmanId,String delFlag,String phone , Pageable pageable);

    Page<ShopInfo>findAllByCityAndDelFlagAndNameContains(String city,String delFlag,String shopName, Pageable pageable);

    List<ShopInfo>findAllByCityAndDelFlag(String city,String delFlag);

    Page<ShopInfo> findAllBySalesmanIdAndDelFlagAndIdContains(String salesmanId, String delFLag, String shopId, Pageable pageable);




}
